<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>高考上头条</title>
    <link href="./assets/css/foolish.css" rel="stylesheet"/>
    <script src="assets/js/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var phoneWidth = parseInt(window.screen.width);
        var phoneHeight = parseInt(window.screen.height);
        var phoneScale = phoneWidth / 640;
        var ua = navigator.userAgent;
        if (/Android (\d+\.\d+)/.test(ua)) {
            var version = parseFloat(RegExp.$1);
            // andriod 2.3
            if (version > 2.3) {
                document.write('<meta name="viewport" content="width=640, initial-scale= ' + phoneScale + ' ,minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
                // andriod 2.3以上
            } else {
                document.write('<meta name="viewport" content="width=640, initial-scale= ' + phoneScale + ' , target-densitydpi=device-dpi">');
            }
            // 其他系统
        } else {
            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
        }
    </script>
</head>
<body>
   <div class="warp">
       <div class="content_bg">
       <img src="./assets/img/foolish_bg.png" rel="stylesheet" width="100%"/>
       </div>
       <div class="content_input">
           <ul>
               <li><input type="text" id="name" placeholder="输入你或你的朋友" class="input_name"/></li>
               <li><input type="text" id="addr" placeholder="输入所在地区" class="input_Region"/></li>
           </ul>
       </div>
       <div class="content_headlineing">
           <input type="image" src="./assets/img/headline2.png" width="100%"  onclick="submit();" />
       </div>
   </div>
</body>
<script>
function submit() {
    var NowFrame = parseInt(Math.random() * 20 + 1);
    var name = document.getElementById('name').value;
    var addr = document.getElementById('addr').value;
    if (name == "") {
        $("#name").attr('placeholder', '姓名不能为空！');
    } else if (addr == "") {
        $("#addr").attr('placeholder', '地区不能为空！');
    } else {
        window.location.href = "headline.html?name=" + escape(name) + "&address=" + escape(addr) + "&contentId=" + NowFrame;
    }
}
</script>
</html>